var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  setprice:function(e){
    var putong = e.detail.value.putong;
    var yueye = e.detail.value.yueye;
    var shangwu = e.detail.value.shangwu;
    var shopid = wx.getStorageSync('shop_id');
    if( putong == '' || yueye =='' || shangwu == ''){
      wx.showToast({
        title: '请将数据补充完成',
        icon: 'none',
        duration: 2000
      })
      return false;
    }else{
      var param = {
        url: 'api/shop/addWashReview',
        data:{
          usually:putong,
          offroad:yueye,
          business:shangwu,
          shop_id:shopid
        },
        success:function(res){
          console.log(res)
          if (res.data.code == 1){
            wx.showToast({
              title: res.data.msg,
              icon: 'none',
              duration: 2000
            })
            setTimeout(function(){
              wx.navigateBack({
                delta:1
              })
            },2000)
          }
        }
      }
      app.post(param);
    }
  }
})